<template>
  <view style="height: 10rpx"></view>
  <u-toast ref="uToast"></u-toast>
  <u-tabs :list="list" @click="Tabs" :scrollable="false" :activeStyle="activeStyle" lineColor="#0c22b0"
    :inactiveStyle="inactiveStyle" itemStyle=" height: 34px; width:50%;"></u-tabs>
  <scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltolower="toLower"
    v-if="myEvlation.list.length > 0">
    <view class="list">
      <view class="item flexs" v-for="item in myEvlation.list" :key="item">
        <!--  avatar -->
        <view class="avatar">
          <image class="boder_r_50" :src="item.avatar == null ? defalutImg : item.avatar" mode="scaleToFill" />
        </view>
        <!-- 内容 -->
        <view class="Msg">
          <view class="name">{{ item.name }}</view>
          <view class="time">{{ forDate(item.time) }}</view>
          <view class="desc">
            {{ item.remark }}
          </view>
        </view>
        <!-- 满意度 -->
        <view class="text" :class="baseData.degree == 1 ? 'text_color' : ''">
          {{ baseData.degree == 1 ? "满意" : "不满意" }}
        </view>
      </view>
    </view>
  </scroll-view>
  <DefaultPage v-if="myEvlation.list.length <= 0" :type="'noMsg'" :tips="'暂无评价'"></DefaultPage>
</template>
<script setup lang="ts">
import evaluation from "@/Hooks/Wode/evaluation";
import { forDate } from '@/utlis/time'
import { onLoad } from "@dcloudio/uni-app";
import DefaultPage from "@/components/DefaultPage.vue";
import { getCurrentInstance } from "vue";
const { proxy } = getCurrentInstance() as any;
const { inactiveStyle, activeStyle, Tabs, list, baseData, myEvlation,
  getEvlationCount, getEvlationLsit, toLower, scrollTop } = evaluation(proxy)
//  默认头像
const defalutImg = "../../static/images/pulice/defaultAvatar.png"
onLoad(() => {
  getEvlationCount()
  getEvlationLsit()

})
</script>
<style scoped lang="scss">
@import "../../static/css/Wode/evaluation.scss";
</style>
